$(function(){	
	//页面加上查询条件
	showCondition(true);
	
		
   // 获取当前登录的科室和科室名
	$.ajax({
		url :contextPath +"/wardMonitor/getUserInfo.dhc",
		async : false,
		type : "POST",
		success : function(result) {
			var wardCode = result.wardCode;
			var wardDesc = result.wardDesc;
			$("#" + tabId + " #wardCode").val(wardCode);
			$("#" + tabId + " #wardDesc").val(wardDesc);
			$("#" + tabId + " #wardtarget").html('<i class="fa fa-file-text-o" ></i>' + wardDesc + "病组指标")
			$("#" + tabId + " #wardalltarget").html('<i class="fa fa-file-text-o" ></i>' + wardDesc + "指标")
			paramTabPage[tabId].wardCode = wardCode;	
			paramTabPage[tabId].wardDesc = wardDesc;
		}
	});

	// 根据当前的科室组code获取科室组名以及调用common方法		
			getQuotas("wardDisMonitor_1", loadData_1, "wardhosp-ul");
	
			function loadData_1(totalQuota){
				/*
				 * 全院指标 (1.Hosp 2.All) 参数：1.查询类型2.查询全部
				 * 数据3.查询的指标以及页签名4.此部分所加载的div的id，3.div下面的ul
				 */
				loadWardAllQuota("ward", totalQuota,"wardHospQuotasId", "wardhosp-ul");
				/*
				 * 加载下面的的div 参数：1.查询指标2.表格头部显示的名字3.布局所在的页面4。div下面的ul
				 */
				loadWardQuota(totalQuota, "MDC","wardDepQuotasId", "warddep-ul");
				// 为下半部分加载数据
				loadWardQuotaData(totalQuota, "mdc", "loadMdcToAdrg","loadMdcToWard");
			}
});


function loadMdcToAdrg(code,desc){
	var param = jQuery.extend(true,{},paramTabPage[tabId]);
	param.mdcCode = code;
	openTab('/pages/ward/wardDisAdrgMonitor.jsp',code+'|ADRG','mdctoadrg'+code,'mdctoadrg'+code,param);

}
function loadMdcToWard(code,desc){
	var param = jQuery.extend(true,{},paramTabPage[tabId]);
	param.mdcCode = code;
	openTab('/pages/ward/wardDisDepMonitor.jsp',code+"|病区",'mdctodep'+code,'mdctodep'+code,param);
}